@import "bootstrap/less/bootstrap.less";
@import "_old-variables";
@import "library/bootswatch";
@import "library/markdeep";
@import "components/bootstrap-overrides";
@import "components/nav";
@import "components/footer";
@import "components/keyframes";
@import "components/buttons";
@import "components/text";
@import "components/tables";
@import "components/execution-output-table";
@import "components/grid";
@import "components/tabs";
@import "components/carets";
@import "components/tabs";
@import "components/links";
@import "components/badges";
@import "components/events-table";
@import "components/forms";
@import "components/icons";
@import "components/version";
@import "components/exec-status";
@import "components/flash";
@import "components/autocomplete";
@import "components/alerts";
@import "components/modals";
@import "components/panels";
@import "components/textual-query";

@popover-wide-max-width: 500px;
@base-item-padding-vertical: 8px;
@base-item-padding-horizontal: 10px;
@list-group-item-padding-vertical: @base-item-padding-vertical;
@list-group-item-padding-horizontal: @base-item-padding-horizontal;

body {
  //   padding-bottom: ((32px + @navbar-margin-bottom));
}
@brand-light: lighten(@brand-primary, 30%);

a {
  text-decoration: underline;

  &.btn,
  &.close,
  &.list-group-item,
  &.navbar-brand,
  .dropdown-menu li &,
  .nav li &,
  .pager li &,
  .summary-count {
    text-decoration: none;
  }
}


.container.app-content {
  margin-bottom: 50px;
}


/* use glyphicon folder icons */
.expandComponentHolder > div > span.expandComponentControl.jobgroupexpand span.foldertoggle {
  width: 16px;
  height: 14px;
  display: inline-block;
  .glyphicon();
  .glyphicon-folder-close();
}

.expandComponentHolder.expanded > div > span.expandComponentControl.jobgroupexpand span.foldertoggle {
  width: 16px;
  /*padding-bottom:14px;*/
  height: 14px;
  display: inline-block;
  .glyphicon();
  .glyphicon-folder-open();
}

.glyphicon-td {
  position: inherit;
  top: auto;
  display: table-cell;
}

//state display
.nowrunning {
  color: darken(@brand-info, 10%);
  font-weight: bold;
  font-style: italic;
}

.execstate {
  &[data-execstate=RETRY] {
    color: @brand-info;
  }

  &[data-execstate=FAILED-WITH-RETRY],
  &[data-execstate=NODE_MIXED],
  &[data-execstate=TIMEDOUT] {
    color: orange;
  }

  &[data-execstate=ABORTED] {
    color: @gray;
  }

  &[data-execstate=SUCCEEDED] {
    color: @gray-dark;
  }

  &[data-execstate=NODE_PARTIAL_SUCCEEDED] {
    color: @gray-dark;
  }

  &[data-execstate=RUNNING],
  .execstate[data-execstate=RUNNING_HANDLER] {
    color: darken(@brand-info, 10%);
  }

  &[data-execstate=SCHEDULED] {
    color: darken(@brand-info, 20%);
  }

  &[data-execstate=RUNNING_HANDLER] {
    border-bottom: 2px dotted orange;
  }

  &[data-execstate=FAILED] {
    color: red;
  }

  &[data-execstate=NOT_STARTED],
  &[data-execstate=WAITING] {
    color: @gray-darker;
  }

  &[data-execstate=PASS] {
    color: @gray;
  }

  &.isnode[data-execstate] {
    color: inherit;
  }

  &.step {
    &[data-execstate=SUCCEEDED] {
      .glyphicon();
      .glyphicon-check();
    }

    &[data-execstate=RUNNING],
    &[data-execstate=RUNNING_HANDLER],
    &[data-execstate=WAITING] {
      .glyphicon();
      .glyphicon-unchecked();
    }

    &[data-execstate=FAILED] {
      .glyphicon();
      .glyphicon-remove-circle();
    }

    &[data-execstate='FAILED-WITH-RETRY'] {
      .glyphicon();
      .glyphicon-repeat();
    }
  }
}

.execstate.execstatedisplay {
  &[data-execstate=RUNNING]:after,
  &[data-execstate=RUNNING_HANDLER]:after {
    content: 'Running';
  }

  &[data-execstate=NODE_MIXED]:after {
    content: 'Mixed';
  }

  &[data-execstate=SUCCEEDED]:after {
    content: 'OK';
  }

  &[data-execstate=OTHER][data-statusstring=incomplete]:after {
    content: 'Incomplete';
    color: orange;
  }

  &[data-execstate=NODE_PARTIAL_SUCCEEDED]:after {
    content: 'Partial';
  }

  &[data-execstate=FAILED]:after {
    content: 'Failed';
  }

  &[data-execstate=FAILED-WITH-RETRY]:after {
    content: 'Failed';
  }

  &[data-execstate=ABORTED]:after {
    content: 'Killed';
  }

  &[data-execstate=TIMEDOUT]:after {
    content: 'Timed Out';
  }

  &[data-execstate=WAITING]:after {
    content: 'Waiting';
  }

  &[data-execstate=WAITING][data-next=true]:after {
    content: 'Next Up';
  }

  &[data-execstate=NOT_STARTED]:after {
    content: 'Not Started';
  }

  &.overall {
    &[data-execstate=SUCCEEDED]:after {
      content: 'Succeeded';
      color: @brand-success;
    }
  }

  &[data-execstate=SCHEDULED]:after {
    content: 'Scheduled';
  }
}

.wfnodestate,
.wfstepstate {
  .subctx {
    .text-muted();
  }

  .stepctx {
    width: 2em;
    display: inline-block;
  }

  .stepnodes {
    margin-left: 10px;
  }

  .nodestatesummary {
    display: none;
  }

  &.collapsed {
    .nodestates {
      display: none;
    }

    .nodestatesummary {
      display: block;
    }
  }
}

.wfnodestate {
  border: 1px solid transparent;
  .border-bottom-radius(@border-radius-base);
  .border-top-radius(@border-radius-base);
  .border-right-radius(@border-radius-base);
  .border-left-radius(@border-radius-base);

  .wfnodeoutput {
    max-height: 500px;
    overflow: auto;

    table.execouput {
      //        width: auto IMPORTANT!;
    }
  }

  .wfnodeoverall .nodectx {}

  &.open {
    border: 1px solid @legend-border-color;
  }

  + .wfnodestate {
    margin-top: @padding-base-vertical;
  }

  .nodename {
    .text-overflow();
  }

  .wfnodestep {
    border: 1px solid transparent;
    .border-bottom-radius(@border-radius-base);
    .border-top-radius(@border-radius-base);
    .border-right-radius(@border-radius-base);
    .border-left-radius(@border-radius-base);
    margin: 4px 0;

    .closed {
      display: none;
    }
  }

  .wfnodestep.open {
    border: 1px solid darken(@legend-border-color,10%);

    .closed {
      display: block;
    }
  }
}

.executionshow {
  .runoutput {
    display: none;
  }

  &.affix {
    .runoutput {
      display: block;
    }
  }
}

.rdicon.job {
  .glyphicon();
  .glyphicon-book();
  vertical-align: baseline;
}
/* use glyphicon for remote option url loading status indicator */
.remote .remotestatus {
  .glyphicon();

  &.ok {
    color: @brand-success;
    .glyphicon-ok-sign();
  }

  &.error {
    color: @brand-warning;
    .glyphicon-warning-sign();
  }
}

.remote .remoteoptionfield:hover {
  background-color: lighten(@brand-info,30%);

  .remotestatus {
    .glyphicon();
    color: @gray;
    .glyphicon-refresh();
  }
}
/*
  * job header padding
  */
.jobInfoSection {
  margin-bottom: 5px;
}

.argstring-scrollable {
  max-height: 100px;
  overflow: auto;
}

//div or other block that has a bound action
.action:hover {
  background: @table-bg-hover;
  cursor: pointer;
}

.action.active {
  background: @table-bg-active;
}

.progress {
  height: @line-height-computed;

  .progress-bar {
    line-height: @line-height-computed;
  }
}

.progress.progress-embed,
.runstatus .progress {
  margin-bottom: 0;
}

.progress-bar {
  white-space: nowrap;
  padding-left: @border-radius-base;
  border-right: 1px solid darken(@progress-bar-color,20%);
}

.well .progress {
  background-color: darken(@progress-bg,10%);
}

.progress.indefinite {
  .progress-bar {
    width: 100% !important;
  }
}

.spacing {
  margin-top: @padding-base-vertical;
}

.spacing-sm {
  margin-top: @padding-small-vertical;
}

.spacing-lg {
  margin-top: @padding-large-vertical;
}

.row {
  &.row-space {
    margin-top: @padding-base-vertical;
  }

  &.row-space-sm {
    margin-top: @padding-small-vertical;
  }

  &.row-space-lg {
    margin-top: @padding-large-vertical;
  }
}

section {
  &.section-space {
    margin-top: @padding-base-vertical;
  }

  &.section-space-sm {
    margin-top: @padding-small-vertical;
  }

  &.section-space-lg {
    margin-top: @padding-large-vertical;
  }

  & + &.section-separator {
    border-top: 1px solid @legend-border-color;
  }

  &.section-separator-solo {
    border-top: 1px solid @legend-border-color;
    border-bottom: 1px solid @legend-border-color;
  }
}
//alternate well without background
.well {
  &.well-nobg {
    background: none;
    border-width: 0;
  }

  &.inline {
    margin: 0;
  }
}
//inset a box by the normal column gutter
.col-inset {
  padding-left: (@grid-gutter-width / 2);
}
//border around a column

.col-box {
  border: 1px solid @table-border-color;
}
// clock icon in scheduled job view is gray if job will not fire
.scheduletime {
  > .glyphicon:first-child {
    color: @brand-success;
  }

  &.disabled .detail,
  &.disabled .glyphicon {
    color: @text-muted;
  }

  &.willnotrun .detail,
  &.willnotrun .glyphicon {
    color: @brand-warning;
  }
}
//tags for nodes
.nodetags .tag {
  background-color: @gray-lighter;
}

a.tag,
span.tag {}

a.tag.active,
span.tag.active {
  color: @label-color;
  border: 1px solid @brand-primary;
  background: @label-primary-bg;
}


/**
   * Nodes page
   */
//run output in nodes page has horizontal border
.nodes_run_content {
  margin-top: 10px;

  & .inlineexecution {
    &.panel-body {
      padding: 0;
    }
  }
}
/** class matchednodes.embed used when showing an embedded list of matched nodes
  */
.matchednodes.embed {
  .node_entry {
    display: inline-block;
    white-space: nowrap;
    padding: 1px;
    margin: 1px 2px;
    border: 1px solid #aaa;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
  }

  &.embed_clean {
    .node_entry {
      border: 0;
      padding: 1px 2px;
      margin: 1px;
      border-radius: 2px;
      -moz-border-radius: 2px;
      -webkit-border-radius: 2px;
    }
  }

  div.info.note {
    margin-bottom: 10px;
  }
}

.outputcontrols {
  border-bottom: 1px solid @nav-tabs-border-color;
}

//affix for execution show page
.executionshow {
  &.affix {
    top: 0;
    right: 0;
    width: 100%;
    background: white;
    z-index: 1;
    .container-fixed();
    padding-top: @navbar-margin-bottom;
    padding-bottom: 10px;
    border-bottom: 1px solid @list-group-border;

    &.panel-heading-affix {
      background-color: @panel-default-heading-bg;
      width: auto;
      margin: 0 15px; //normal col padding
      padding: @base-item-padding-vertical @base-item-padding-horizontal;
    }
  }
}

.affix .affixed-hidden {
  display: none;
}

.affixed-shown {
  display: none;

  .affix & {
    display: block;
  }

  .affix &.affixed-shown-inline {
    display: inline;
  }
}

.log_line {
  white-space: pre-wrap;

  &.no-wrap {
    white-space: pre;
  }
  font-family: "Lucida Console", courier, monospace;
  color: black;

  &.level_debug,
  &.level_verbose {
    color: @brand-light;
  }

  &.level_error,
  &.level_warn {
    color: #800;
  }
}



.stepident,
.stepnum {
  //    color: @brand-light;
}

//workflow editor, option editor, autohilite:
btn.autohilite:hover,
span.autohilite:hover {
  background: lighten(@brand-info, 40%);
}

span.autoedit {
  padding: 3px;
  cursor: pointer;
}

span.autoedit:hover {
  padding: 2px;
  border: 1px dotted @brand-info;
}
/**
   * single step or option edit box
   */
.optEditForm,
.wfitemEditForm {
  border: 2px solid @legend-border-color;
  .border-bottom-radius(@border-radius-base);
  .border-top-radius(@border-radius-base);
  padding: @base-item-padding-vertical @base-item-padding-horizontal;

  &.container {
    background: white;
  }
}
//option values in code sections
.optvalue {
  color: @text-muted;

  &.optextra {
    border-bottom: 1px dashed @text-muted;
  }
}

.optkey {
  color: @brand-primary;
}

//node detail
/** node detail */
.nodedetail {
  & tr td.key {
    width: 200px;
    vertical-align: top;

    &.namespace {
      padding-right: 20px;
    }
  }

  & .key {
    text-align: right;
    font-weight: bold;
    color: #555;
  }

  & tr .value {
    vertical-align: top;
    max-width: 800px;
  }

  &.detailpopup {
    max-height: 500px;
    max-width: 600px;
    overflow-y: auto;
  }

  &.embed {
    & tr .value {
      max-width: 400px;
    }
  }
}

.node_entry {
  .hostname,
  .nodedesc,
  .nodeident,
  .nodetags,
  .username {
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
  }

  .nodetags {
    max-width: 20em;
  }
}

.node_entry.server .nodedesc:before {
  color: #f66;
  content: " server ";
  padding-left: 18px;
}

.nodedetail.server .nodedesc:before {
  color: #f66;
  content: " server " "\2022" " ";
  padding-left: 18px;
}

//search icons
.hover-action-holder {
  .hover-action {
    visibility: hidden;
  }

  &:hover .hover-action {
    visibility: visible;
  }
}
//override padding for list-group-item
.list-group-item {
  padding: @list-group-item-padding-vertical @list-group-item-padding-horizontal;
}

input.placeholder {
  color: gray;
}

//pre formatted regex syntax error for node filters
pre.filtererror {
  background-color: transparent;
  border: none;
  color: @brand-info;
  padding: 0;
}

.overflowx {
  text-overflow: ellipsis;
  overflow-x: auto;

  .scroll {
    overflow-x: scroll;
  }
}

.overflowy {
  max-height: 300px;
  overflow-y: auto;
}

//help tooltip
.helptooltip {
  position: absolute;
  background: white;
  max-width: 500px;
  width: 500px;
}
//updates for bootswatch
.btn.active {
  .box-shadow(none);
}

//popover variation
.popover {
  &.popover-wide {
    max-width: @popover-wide-max-width;
  }
}

.autohide {
  visibility: hidden;
}

.autoshow:hover .autohide {
  visibility: visible;
}
